<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
if(h<_rate*1206){h=_rate*1206;}
var _img=['m.png'];
var loader = new PxLoader();
for(var i=0; i<_img.length; i++){loader.addImage('./img/'+_img[i]);}
loader.start();
loader.addCompletionListener(function(e){
	   $(".p1").fadeIn(800).css({"opacity":1});
});
$(function(){
	document.body.addEventListener('touchmove', function (e) {
		  e.preventDefault();  
	}, {passive: false});
	$('.container, .bigbg, .p22bg').width(sWidth).height(h);
	$('.thebg, .p-b, .p19x').width(sWidth).height(_rate*1206);
	$('.arw').width(_rate*41).height(_rate*46).css({"left":_rate*354});
	$('.p1-t1, .p1-t2').css({"top":0});
	$('.p1-t3').css({"top":_rate*470});
	$('.p1-t4').width(_rate*136).height(_rate*130).css({"top":_rate*848, "left":_rate*310});
	$('.p1-t5').css({"top":_rate*976});
	$('.g1').width(_rate*108).height(_rate*42).css({"top":_rate*48, "left":70});
	$('.g2').width(_rate*169).height(_rate*19).css({"top":_rate*146, "left":_rate*170});

	$('.p11-t2').css({"top":_rate*1040});
	
 
	$('.p-s').width(_rate*750).height(h); 
	var swiper = new Swiper('.p-s', {
		   initialSlide:0,
		   direction:'vertical',
		   speed:160,
		   touchAngle:360,
		   on:{
		        transitionStart: function(){
		        	$('.g1').hide().css({"left":70, 'opacity':1});
		        	$('.g2').hide().css({"left":_rate*170, 'opacity':1});
		        	$(".animated, .arw, .animat2").hide();
		        	if(0 == this.activeIndex){
		        	  $(".p1-t4").removeClass("arr");
		        	}
		        },
		        transitionEnd: function(swiper){
		        	$(".arw").show();
		        	if(0 == this.activeIndex){
				        $(".p1-t1, .p1-t2, .p1-t3, .p1-t4, .p1-t5").show();
				        window.setTimeout(function(){
				        	$(".p1-t4").addClass("arr");
					        }, 3400);
				        return;
					}
			        if(1 == this.activeIndex){
			           $(".p1-t4").removeClass("arr");
			           $(".p2-pb").show();
                       $(".p2 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
                       $(".p2 .g2").show().animate({'left':_rate*540,'opacity':0},1000);
                       return;
   				    }
			        if(2 == this.activeIndex){
			        	$(".p3-t1, .p3-pb").show();return;
				    }
			        if(3 == this.activeIndex){
			        	$(".p4-pb").show();return;
				    }
			        if(4 == this.activeIndex){
			        	$(".p5-t1, .p5x").show();return;
	   				}
			        if(5 == this.activeIndex){
			        	$(".p6-pb").show();
	                    $(".p6 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
	                    $(".p6 .g2").show().animate({'left':_rate*540,'opacity':0},1000);    
	   				}
			        if(6 == this.activeIndex){
			        	$(".p7-pb").show();
	                    $(".p7 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
	                    $(".p7 .g2").show().animate({'left':_rate*540,'opacity':0},1000);    
	   				}
			        if(7 == this.activeIndex){
			        	$(".p8-pb").show();
	                    $(".p8 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
	                    $(".p8 .g2").show().animate({'left':_rate*540,'opacity':0},1000);    
	   				}
			        if(8 == this.activeIndex){
			        	$(".p9-pb").show();    
					}
			        if(9 == this.activeIndex){
			        	$(".p10-pb").show();
					}
			        if(10 == this.activeIndex){
			        	$(".p11x, .p11-t1, .p11-t2").show();
					}
			        if(11 == this.activeIndex){
			        	$(".p12-pb").show();
					}
					if(12 == this.activeIndex){
					   $(".p13-pb").show();
					}
					if(13 == this.activeIndex){
					   $(".p14-pb").show();
                       $(".p14 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
                       $(".p14 .g2").show().animate({'left':_rate*540,'opacity':0},1000);
                       return;
					}
					if(14 == this.activeIndex){
					   $(".p15-pb").show();
                       $(".p15 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
                       $(".p15 .g2").show().animate({'left':_rate*540,'opacity':0},1000);
                       return; 
					}
					if(15 == this.activeIndex){
						$(".p16-pb").show();
	                       $(".p16 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
	                       $(".p16 .g2").show().animate({'left':_rate*540,'opacity':0},1000);
	                       return; 
					}
					if(16 == this.activeIndex){
						$(".p17-pb").show();
	                       $(".p17 .g1").show().animate({'left':_rate*520,'opacity':0},1000);
	                       $(".p17 .g2").show().animate({'left':_rate*540,'opacity':0},1000);
	                       return; 
					}
					if(17 == this.activeIndex){
						$(".p18-pb").show(); 
					}
					if(18 == this.activeIndex){
						$(".p19-pb").show(); 
					}
					if(19 == this.activeIndex){
						$(".p20-pb").show(); 
					}
					if(20 == this.activeIndex){
						$(".p21-pb").show(); 
					}
					if(21 == this.activeIndex){
						$(".p22x").show(); 
					}
			         
		          }
		        }
	    } );
	window.setTimeout(function(){
    	$(".p1-t4").addClass("arr");
        }, 3400);
	if(h > _rate*1206){
		   var _cha= (h - _rate*1306)/2;
		   if(_cha > 0){
		      $('.thebg').css({"top":_cha});

		      $(".p2x").attr("src","<?php echo $cdnUrl; ?>img/p2-x.jpg");
		      $(".p3x").attr("src","<?php echo $cdnUrl; ?>img/p3-x.jpg");
		      $(".p4x").attr("src","<?php echo $cdnUrl; ?>img/p4-x.jpg");
		      $(".p5x").attr("src","<?php echo $cdnUrl; ?>img/p5-x.jpg");
		      $(".p6x").attr("src","<?php echo $cdnUrl; ?>img/p6-x.jpg");
		      $(".p7x").attr("src","<?php echo $cdnUrl; ?>img/p7-x.jpg?v=2");
		      $(".p8x").attr("src","<?php echo $cdnUrl; ?>img/p8-x.jpg");
		      $(".p9x").attr("src","<?php echo $cdnUrl; ?>img/p9-x.jpg");
		      $(".p10x").attr("src","<?php echo $cdnUrl; ?>img/p10-x.jpg");
		      $(".p11x").attr("src","<?php echo $cdnUrl; ?>img/p11-x.jpg");

		      $(".p12x").attr("src","<?php echo $cdnUrl; ?>img/p12-x.jpg");
		      $(".p13x").attr("src","<?php echo $cdnUrl; ?>img/p13-x.jpg");
		      $(".p22x").attr("src","<?php echo $cdnUrl; ?>img/p22-x.jpg");
		      $('.p11-t2').css({"top":_rate*1140});


		      
		      $('.p11x, .p5x').height(_rate*1448);
		      $('.p5x').height(_rate*1448).css({"top":_cha});
		      $('.p22x').height(_rate*1464);
		      
		   }
    }

	wx.config({
        appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,
        nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage','onMenuShareQQ','showMenuItems','showOptionMenu']
    });
    wx.ready(function () {
    		var _title='URARA';
    		var _desc='恒采之能奢宠系列商谈手册';
    		var _link='http://urara.mei94.com/';
    		var _imgUrl='http://urara.mei94.com/img/6.jpg';
    			wx.onMenuShareTimeline({title: _desc, link: _link, imgUrl: _imgUrl,success: function () {
    			},cancel: function () { 
    			}});
    			wx.onMenuShareAppMessage({ title: _title, desc: _desc,link: _link,imgUrl: _imgUrl, type: '', dataUrl: '', success: function () {
    			},cancel: function () { 
    			}});
    });
	 
  
});
</script>